#pragma once
#include "RBTreePackage.h"

namespace ForcibleBugMaker
{

	template<class K>
	class set
	{
		struct SetKeyOfValue
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
	public:
		typedef typename RBTree<K, const K, SetKeyOfValue>::iterator iterator;
		typedef typename RBTree<K, const K, SetKeyOfValue>::const_iterator const_iterator;
		iterator begin()
		{
			return _t.Begin();
		}

		iterator end()
		{
			return _t.End();
		}
		const_iterator begin() const
		{
			return _t.Begin();
		}
		const_iterator end() const
		{
			return _t.End();
		}

		std::pair<iterator, bool> insert(const K& key) 
		{
			return _t.Insert(key);
		}

		iterator find(const K& key)
		{
			return _t.Find(key);
		}

		void clear()
		{
			_t.Clear();
		}

	private:
		RBTree<K, const K, SetKeyOfValue> _t;
	};

}